package com.ytzl.exceptions;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

//@ControllerAdvice
public class ItripUserCodeNotRegistException extends Throwable {

    @ExceptionHandler(value = RuntimeException.class)
    public String exceptionHandler(Exception ex){
        System.out.println("用户名已被注册");
        return ex.getMessage();
    }
}
